package com.woniuxy.hrp.security;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 继承于security.core.userdetails.User
 * 提供一些额外的信息
 */
@Getter
@Setter
public class HrpUser extends User {

    public HrpUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }
    public HrpUser(int id, String username, String password , int roleId, Collection<? extends GrantedAuthority> authorities){
        this(username,password,authorities);
        this.id=id;
        this.roleId=roleId;
    }
    private int id;
    private int roleId;

}
